package com.tbit.manager.api;


import com.tbit.manager.api.dto.NoticeDTO;
import com.tbit.manager.enums.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = ApiConstants.NAME)
public interface NoticeApi {

    String PREFIX = ApiConstants.PREFIX + "/notice";
    /**
     * @description: 获取用户的公告集合
     * @author: mo.shanyong
     * @date: 2025/2/21 15:10
     * @param: noticeSearchDTOStr 搜索条件实体转变的字符串
     * @return: java.util.List<com.tbit.manager.api.dto.NoticeDTO>
     */
    @GetMapping(PREFIX + "/getUserNoticeList")
    Map<String,Object> getUserNoticeList(@RequestParam("noticeSearchDTOStr") String noticeSearchDTOStr);



    /**
     * @description: 记录公告日志
     * @author: mo.shanyong
     * @date: 2025/2/21 15:22
     * @param: noticeId
     * @param: operateType 日志类型：1、曝光；3、点击；5、阅读(目前只记录了这个)
     * @param: userId
     * @return: java.lang.Integer
     */
    @PostMapping( value = PREFIX + "/recordNoticeLog", consumes = "application/json")
    Integer recordNoticeLog(@RequestBody NoticeDTO noticeDTO);
}
